package com.easycar.common.util;

import android.os.Build;

import com.easycar.common.exception.InitializationException;
import com.easycar.common.manager.ActivityManager;


/**
 * 退出APP
 */
public class ExitApp {

    /**
     * 退出APP
     */
    public static void killAppProcess() {
        ActivityManager.getInstance().clear();
        if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.JELLY_BEAN_MR2) {
            android.os.Process.killProcess(android.os.Process.myPid());
        } else {
            System.exit(0);
        }

    }
    private ExitApp()    {
          throw   new InitializationException("Exit app");
    }

}
